package com.liao.rent.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 房源表
 * </p>
 *
 * @author liao
 * @since 2024-11-30
 */
@Getter
@Setter
@TableName("house")
@Schema( description = "房源表")
public class House implements Serializable {

    private static final long serialVersionUID = 1L;

     @Schema(title = "房源id")
     @TableId(value = "house_id", type = IdType.AUTO)
    private Integer houseId;

     @Schema(title = "房东id")
    @TableField("user_id")
    private Integer userId;

     @Schema(title = "房源类型(1.标识整租，2.标识合租)")
    @TableField("house_type")
    private Byte houseType;

     @Schema(title = "房源标题")
    @TableField("title")
    private String title;

     @Schema(title = "详细描述内容")
    @TableField("content")
    private String content;

     @Schema(title = "城市名称")
    @TableField("city")
    private String city;

     @Schema(title = "详细地址")
    @TableField("address")
    private String address;

     @Schema(title = "轮播图url")
    @TableField("banner_url")
    private String bannerUrl;

     @Schema(title = "月租")
    @TableField("month_price")
    private BigDecimal monthPrice;

     @Schema(title = "房源状态（0为出租，1已经出租，2下架）")
    @TableField("status")
    private Integer status;

     @Schema(title = "房源面积")
    @TableField("area")
    private BigDecimal area;

     @Schema(title = "经纬度")
    @TableField("Longitude_latitude")
    private String longitudeLatitude;

     @Schema(title = "出租记录id")
    @TableField("record_id")
    private Integer recordId;


    //    @ApiModelProperty("创建时间")
    @Schema(title = "创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    //    @ApiModelProperty("修改时间")
    @Schema(title = "修改时间")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    //    @ApiModelProperty("创建人")
    @Schema(title = "创建人")
    @TableField(value = "create_user",fill = FieldFill.INSERT)
    private Integer createUser;

    //    @ApiModelProperty("修改人")
    @Schema(title = "修改人")
    @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
}
